Repository navigation
datetime.tzinfo is abtract - #8908
Conversation
This comment has been minimized.
This comment has been minimized.
|
I was following return types from https://docs.python.org/3/library/datetime.html#datetime.timezone |
|
|
|
Diff from mypy_primer, showing the effect of this PR on open source code: |
|
Example in Sphinx is technically correct:
I will send a PR. |
hauntsaninja
left a comment
There was a problem hiding this comment.
Do we need to add the metaclass, since runtime doesn't have it? mypy allows for checking abstractmethod without metaclass
Yes, we sometimes need this. Please, take a look at this error: |
|
Basically, |
|
Oh interesting, didn't realise there was this stub-only check: https://github.com/python/mypy/blob/5e1e26eba15b43449bdce4010bf16d160d3ec505/mypy/semanal_classprop.py#L97 |
|
We need the metaclass change in |
This class is not marked as abstract, but it is documented:
Source: https://github.com/python/cpython/blob/f6b1e4048dc353aecfbfbae07de8212900632098/Lib/datetime.py#L1222-L1243